{% extends "base.html" %}

{% block title %}活动类型信息{% endblock %}

{% block meta %}

<!-- STYLESHEETS -->

<link rel="stylesheet" media="screen" href="/static/css/reset.css" />
<link rel="stylesheet" media="screen" href="/static/css/grids.css" />
<link rel="stylesheet" media="screen" href="/static/css/style.css" />
<link rel="stylesheet" media="screen" href="/static/css/forms.css" />
<link rel="stylesheet" media="screen" href="/static/css/jquery.uniform.css" />
<link rel="stylesheet" media="screen" href="/static/css/themes/lightblue/style.css" />

<!-- DATATABLES CSS -->
<link rel="stylesheet" media="screen" href="/static/lib/datatables/css/cleanslate.css" />
<!-- DATATABLES CSS END -->

{% endblock %}

{% block header %}

					<li class="dropdown active"> 
						<a href="dashboard.html#a">active item</a> 
						<ul> 
							<li> 
								<a href="dashboard.html#aa">menu item</a> 
							</li> 
							<li class="dropdown"> 
								<a href="dashboard.html#ab">menu item</a> 
								<ul> 
									<li class="current"><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#aba">menu item</a></li> 
									<li><a href="dashboard.html#abb">menu item</a></li> 
									<li><a href="dashboard.html#abc">menu item</a></li> 
									<li><a href="dashboard.html#abd">menu item</a></li> 
								</ul> 
							</li> 
							<li class="dropdown"> 
								<a href="dashboard.html#">menu item</a> 
								<ul> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
								</ul> 
							</li> 
							<li class="dropdown"> 
								<a href="dashboard.html#">menu item</a> 
								<ul> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
								</ul> 
							</li> 
						</ul> 
					</li> 
					<li> 
						<a href="dashboard.html#">menu item</a> 
					</li> 
					<li class="dropdown"> 
						<a href="dashboard.html#">menu item</a> 
						<ul> 
							<li class="dropdown"> 
								<a href="dashboard.html#">menu item</a> 
								<ul> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
								</ul> 
							</li> 
							<li class="dropdown"> 
								<a href="dashboard.html#">menu item</a> 
								<ul> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
								</ul> 
							</li> 
							<li class="dropdown"> 
								<a href="dashboard.html#">menu item</a> 
								<ul> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
								</ul> 
							</li> 
							<li class="dropdown"> 
								<a href="dashboard.html#">menu item</a> 
								<ul> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
									<li><a href="dashboard.html#">menu item</a></li> 
								</ul> 
							</li> 
						</ul> 
					</li> 
					<li class="dropdown"> 
                        <a href="dashboard.html#">Themes</a> 
                        <ul>
                            <li><a href="dashboard.html">Lightblue</a></li> 
                            <li><a href="gray.html">Gray</a></li> 
                            <li><a href="dark.html">Dark</a></li> 
                        </ul> 
					</li>	
                    <li class="fr dropdown"> 
                        <a href="dashboard.html#" class="with-profile-image"><span><img src="/static/images/profile-image.png" /></span>Administrator</a> 
                        <ul> 
                            <li><a href="dashboard.html#">Settings</a></li> 
                            <li><a href="dashboard.html#">Users</a></li> 
                            <li><a href="dashboard.html#">Groups</a></li> 
                            <li><a href="dashboard.html#">Signout</a></li> 
                        </ul>
                    </li> 

{% endblock%}

{% block aside %}

                <nav>
                    <h2>课程管理</h2>
                    <ul>
                        <li><a href="{% url course_list %}">课程列表</a></li>
                        <li><a href="{% url course_add %}">添加课程</a></li>
                    </ul>
                </nav>
                <nav>
                    <h2>授课单元管理</h2>
                    <ul>
                        <li><a href="{% url lesson_list %}">授课单元列表</a></li>
                        <li><a href="{% url lesson_add %}">添加授课单元</a></li>
                    </ul>
                </nav>
                <nav>
                    <h2>班级管理</h2>
                    <ul>
                        <li><a href="{% url class_list %}">班级列表</a></li>
                        <li><a href="{% url class_add %}">添加班级</a></li>
                        <li><a href="{% url student_import %}">班级学生导入</a></li>
                    </ul>
                </nav>
                
                <nav>
                    <h2>教学活动类型</h2>
                    <ul>
                        <li><a href="{% url active_type_list %}">活动类型列表</a></li>
                        <li><a href="{% url active_type_add %}">添加活动类型</a></li>
                        <li class="current"><a href="{% url active_type_detail active_type.id %}">活动类型信息</a></li>
                    </ul>
                </nav>

{% endblock %}

{% block content %}

                 <header class="container_12 clearfix">
                    <div class="grid_12">
                        <h1>活动类型信息</h1>
                    </div>
                </header>
                
                <section class="container_12 clearfix">
                
                    <section class="grid_12"> 
                        <div class="message info">
                            <h3>活动类型名称：{{ active_type.label }}</h3>
                        </div>
                    </section> 
                   
                {% for attach in active_type.attachs.all %}
                    <section class="portlet grid_12 leading">
                        <header>
                            <h2>{{ attach.label }}</h2>
                        </header>
                        <section>
                            {{ attach.content|safe }}
                        </section>
                    </section>
                {% endfor %}
                
                
                    <section class="portlet grid_12 leading">
                        <header>
                            <h2>内容项列表（原子操作）</h2>
                        </header>
                        <br />
                        
                        <form class="form has-validation" action="/content/active_type_atom_add/" method="post">
                            {% csrf_token %}
                            <input type="hidden" name="active_type" value="{{ active_type.id }}" />
                            
                            <div class="clearfix">
                                <label for="form-atom" class="form-label no-description">添加内容项 </label>
                                <div>&nbsp;&nbsp;
                                    名称：<input type="text" id="form-label" name="label" />
                                  内容项：<select id="section0" name="atom">
                                        {% for item in atom_choices %}
                                            <option value="{{ item|first }}">{{ item|last }}</option>
                                        {% endfor %}
                                    </select>
                                    &nbsp;&nbsp;<button class="button" type="submit" data-icon-primary="ui-icon-circle-check">添加</button>
                                </div>
                            </div>
                        </form>
                        
                        <div class="grid_12">
                            <div id="demo" class="clearfix"> 
                                <table class="display" id="example"> 
                                    <thead> 
                                        <tr> 
                                            <th>内容项名称</th> 
                                            <th>内容项形式</th> 
                                            <th>结果处理方式</th>
                                            <th>操作</th>
                                        </tr> 
                                    </thead> 
                                    <tbody> 
                                    {% for atom in active_type.atoms.all %}
                                        <tr> 
                                            <td>{{ atom.label }}</td> 
                                            <td>{{ atom.atom }}</td> 
                                            <td class="center">{% for handler in atom.handlers.all %}handler.handler{% endfor %}</td> 
                                            <td class="center">编辑 删除</td> 
                                        </tr> 
                                    {% endfor %}
                                    </tbody> 
                                </table> 
                            </div> 
                        </div>
                    </section>
                    
                </section>
                
    
                <footer class="container_12 clearfix">
                    <div class="grid_12">
                        Copyright &copy; 2011. Theme by <a target="_blank" href="http://themeforest.net/user/vivantdesigns?ref=vivantdesigns">VivantDesigns</a>
                    </div>
                </footer>
{% endblock %}

{% block scripts %}

    <!-- DATATABLES -->
    <script type="text/javascript" src="/static/lib/datatables/js/jquery.dataTables.js"></script> 
    <script type="text/javascript"> 
        $(document).ready(function() {
            $('#example').dataTable( {
                "sPaginationType": "full_numbers",
                "aoColumns": [
                            { 
                                "sClass": "center"
                            },
                            { 
                                "sClass": "center"
                            },
                            {
                                "bSortable": false,
                                "sClass": "center"
                            },
                            {
                                "bSortable": false,
                                "sClass": "center"
                            },
                        ],
            } );
        } );
    </script> 
    <!-- DATATABLES END -->

{% endblock %}
